package com.aaa.ssm.controller;

import com.aaa.ssm.entity.TmScenic;
import com.aaa.ssm.service.TmScenicService;
import com.aaa.ssm.util.Page;
import com.aaa.ssm.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("tmscenic")
public class TmScenicController extends BaseController {
    @Resource
    private TmScenicService tmScenicService;

    //分页带参
    @PostMapping("page")
    public Result queryPage(@RequestBody Page<TmScenic> page){
        return success(tmScenicService.queryByParam(page));
    }

    //添加
    @PostMapping("add")
    public Result add(@RequestBody TmScenic tmScenic){
        return success(tmScenicService.add(tmScenic));
    }
    //更新
    @PostMapping("update")
    public Result update(@RequestBody TmScenic tmScenic){
        return success(tmScenicService.update(tmScenic));
    }

    //删除
    @DeleteMapping("/{id}")
    public Result deleteById(@PathVariable String id){
        return success(tmScenicService.deleteById(id));
    }

}
